
<div class='fui-page fui-page-current page-commission-register'>

    <div class="fui-header">
        <div class="fui-header-left">
            <a class="back" ng-click='goback()'></a>
        </div>
        <div class="title">{{pagedata.apply_setting.top_title||'申请成为'+pagedata.page_setting.agent_title}}</div>
        <div class="fui-header-right"></div>
    </div>
	<div class='fui-content'>
        <img style='width:100%;position: relative' ng-src="{{tomedia(pagedata.apply_setting.regbg) || '../addons/jy_nongfee/resource/images/bg.png'}}" />
		<div ng-if="!pagedata.apply.id && pagedata.become==1 || pagedata.agent_level==0 || pagedata.member.stop==1" class='content-empty' >
            <i class='icon icon-info text-danger'></i>
            <br/><span class="text-danger">禁止访问，请联系客服！</span>
            <br/><a ng-if="pagedata.index_url" class="btn btn-danger" href="javascript:;" ng-click="access_json(pagedata.index_url)">去商城逛逛</a>
        </div>
        <div ng-if="(!pagedata.apply.id || pagedata.applyagain) && pagedata.become==2">
        <div class="fui-cell-group" style='margin-top:0'>
            <div class="fui-cell-title">
                欢迎加入<span class='text-danger'>{{pagedata.apply_setting.shop_title}}</span>，请填写申请信息
            </div>
            <div class='fui-cell must'>
                <div class='fui-cell-label'>姓名</div>
                <div class='fui-cell-info'><input type="text" class='fui-input' ng-model="pagedata.item.realname" placeholder="请填写真实姓名，用于结算" /></div>
            </div>
            <div class="fui-cell must ">
				<div class="fui-cell-label ">手机号</div>
				<div class="fui-cell-info"><input type="text" class='fui-input' placeholder="设置手机号" ng-model="pagedata.item.mobile" /></div>
				<div ng-if="pagedata.item.login_type>0 && !pagedata.bindmobile && pagedata.item.oldmobile" class="fui-cell-remark noremark"><a class="btn btn-default btn-default-o btn-sm" ng-click="pagedata.bindmobile=true;pagedata.item.mobile=''">解绑手机</a></div>
				<div ng-if="pagedata.item.login_type>0 && (pagedata.bindmobile || !pagedata.item.oldmobile)" class="fui-cell-remark noremark"><a class="btn btn-default btn-default-o btn-sm" ng-click="tool.mobile_code(pagedata.item.mobile,'sms_code')" id="sms_code">获取验证码</a></div>
			</div>
			<div ng-if="pagedata.item.login_type>0 && (pagedata.bindmobile || !pagedata.item.oldmobile)" class="fui-cell must ">
				<div class="fui-cell-label ">验证码</div>
				<div class="fui-cell-info"><input type="text" class='fui-input' placeholder="请输入验证码" ng-model="pagedata.item.smscode" /></div>
			</div>
            <div class='fui-cell'>
                <div class='fui-cell-label'>微信号</div>
                <div class='fui-cell-info'><input type="text" class='fui-input' ng-model="pagedata.item.wechat" placeholder="请填写微信号"  /></div>
            </div>
			<div class="weui_cells_title">代理地区</div>
			<div class="weui_cells">
				<div class="weui_cell weui_cell_switch">
						<div class="weui_cell_hd weui_cell_primary">申请【多省代】？</div>
						<div class="weui_cell_ft">
							<input class="weui_switch" type="checkbox" ng-checked="pagedata.item.is_duodai" checked="checked" ng-model="pagedata.item.is_duodai">
						</div>
				</div>
				<div ng-if="!pagedata.item.is_duodai" class="weui_cell weui_cell_select">
					<div class="weui_cell_bd weui_cell_primary">
						<select class="weui_selectpcd" ng-model="pagedata.item.area.province"  ng-change="pagedata.item.area.city=undefined;pagedata.item.area.district=undefined;pagedata.item.area.street=undefined">
							<option value="" selected="selected">省份</option>
							<option ng-repeat="(value,data) in pagedata.areas" ng-selected="pagedata.item.area.province==value"  value="{{value}}">{{value}}</option>
						</select>
					</div>
					<div class="weui_cell_bd weui_cell_primary" ng-if="pagedata.agent_level>1" >
						<select class="weui_selectpcd" ng-model="pagedata.item.area.city" ng-change="pagedata.item.area.district=undefined;pagedata.item.area.street=undefined">
							<option value="" selected="selected">城市</option>
							<option ng-repeat="(value,data) in pagedata.areas[pagedata.item.area.province]" ng-selected="pagedata.item.area.city==value" value="{{value}}">{{value}}</option>
						</select>
					</div>
					<div class="weui_cell_bd weui_cell_primary" ng-if="pagedata.agent_level>2">
						<select class="weui_selectpcd" ng-model="pagedata.item.area.district" ng-change="pagedata.item.area.street=undefined">
							<option value="" selected="selected">区县</option>
							<option ng-repeat="(value,data) in pagedata.areas[pagedata.item.area.province][pagedata.item.area.city]" ng-selected="pagedata.item.area.district==value" value="{{value}}">{{value}}</option>
						</select>
					</div>
					<div class="weui_cell_bd weui_cell_primary" ng-if="pagedata.agent_level>3">
						<select class="weui_selectpcd" ng-model="pagedata.item.area.street">
							<option value="" selected="selected">街道</option>
							<option ng-repeat="value in pagedata.areas[pagedata.item.area.province][pagedata.item.area.city][pagedata.item.area.district]" ng-selected="pagedata.item.area.street==value" value="{{value}}">{{value}}</option>
						</select>
					</div>
				</div>
				<div ng-if="pagedata.item.is_duodai" class="weui_cells_checkbox">
					<label ng-repeat="(value,data) in pagedata.areas" class="weui_cell weui_check_label" for="s11">
						<div class="weui_cell_bd weui_cell_primary">
							<span>{{value}}</span>
						</div>
						<div class="weui_cell_hd" ng-click="duoxuans(value,pagedata.item,'duodai')">
							<input type="checkbox" class="weui_check"  value="{{value}}" ng-checked="pagedata.item.duodai.indexOf(';'+value+';')>=0">
							<i class="weui_icon_checked"></i>
						</div>
					</label>
				</div>
			</div>
            <div class="fui-cell-group">
                <div class="fui-cell small ">
                    <div class="fui-cell-info">

                        <label class="checkbox-inline">
                            <input type="checkbox" class="fui-checkbox-primary" ng-model="pagedata.item.agree" /> 我已经阅读并了解了<a id="btn-apply" ng-click="pagedata.show_content=true" style="color:#337ab7;">【{{pagedata.apply_setting.apply_title || '代理协议'}}】</a>。
                        </label>

                    </div>
                </div>

            </div>
			 <div ng-show="pagedata.show_content" class="modal-bg pop-apply-hidden" >
                <div class="modal-content" style="top:10%;width:90%;left:5%">
                    <div class="closebtn" ng-click="pagedata.show_content=false" style="opacity:1;"><i class="icon icon-cuowu"></i></div>
                    <div class="news-body">
						<div class="title">{{pagedata.apply_setting.apply_title || '代理协议'}} / <small>Read &nbsp;Ggree</small></div>
                        <div class="text" ng-bind-html="trust(pagedata.apply_setting.apply_content)"></div>
                    </div>
					<div class="modal-footer">
                            <div ng-click="pagedata.show_content=false" class="mod-check" style="width: 100%; margin: 0;">我已阅读</div>
                    </div>
                </div>
            </div>
        </div>
        <div class='btn btn-danger block btn-submit' ng-click="post(pagedata.item,'/area.apply/post/')">申请成为{{pagedata.page_setting.agent_title}}</div>
		</div>
		<div ng-if="pagedata.apply.id && !pagedata.applyagain" class='fui-content'>
			<div ng-if="pagedata.apply.status==0" class='content-info' >
				<i class='icon icon-clock'></i>
				<br/><span class="">谢谢您的支持，请等待审核！</span>
				<br/><a ng-if="pagedata.index_url" class="btn btn-danger" href="javascript:;" ng-click="access_json(pagedata.index_url)">去商城逛逛</a>
			</div>
			<div ng-if="pagedata.apply.status==1 && pagedata.member.is_agent!=1" class='content-info' >
				<i class='icon icon-clock'></i>
				<br/><span class="">您的代理商身份已经清空！无法再申请代理商！</span>
				<br/><a ng-if="pagedata.index_url" class="btn btn-danger" href="javascript:;" ng-click="access_json(pagedata.index_url)">去商城逛逛</a>
			</div>
			<div ng-if="pagedata.member.is_agent==1" class='content-info' >
				<i class='icon icon-clock'></i>
				<br/><span class="">恭喜您，您的代理申请已审核通过！</span>
				<br/><a class="btn btn-danger" href="javascript:;" ng-click="access_json('jy_nongfee/area.index/')">前往代理中心</a>
			</div>
			<div ng-if="pagedata.member.is_agent==2 || pagedata.apply.status==2" class='content-info' >
				<i class='icon icon-clock'></i>
				<br/><span class="">非常抱歉，您的代理申请被管理员拒绝！</span>
				<br/><span class="">未审核通过原因：</span>
				<br/><span class="subtitle">{{pagedata.apply.remark || '无'}}</span>
				<br/><a class="btn btn-danger" href="javascript:;" ng-click="pagedata.applyagain=1">重新申请</a>
			</div>
		</div>
    </div>

</div>

